﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Resto.CostControl.Common.Consts;

namespace Resto.CostControl.WebControl.Service.SelectListAdapter
{
    internal static class SelectListQueryHelper
    {
        public static List<SelectListItem> QuerySelectListItemByType(string type)
        {
            ISelectListItemQuery query = null;

            switch (type)
            {
                case DataSourceConsts.String_Supplier_Code:
                    query = new SupplierQuery();
                    break;
                case DataSourceConsts.String_Material_Code:
                    query = new MaterialQuery();
                    break;
                default:
                    break;
            }

            if (query == null)
                return new List<SelectListItem>();

            return query.QuerySelectListItem();
        }
    }
}
